package com.shu.weight;

public class H5WeightManager {

	public static void main(String[] args) {
		H5WeightManager m = new H5WeightManager();
		//1.男子：BMR = 66 +（13.7×WT公斤）+（5×身高厘米）-（6.8×年龄） 
		//  女子：BMR(基础代谢)=655.1+(9.6*KG(体重))+(1.8*CM(身高))-(4.7*年龄)

		Integer gender = 1;
		Integer weight = 60;
		Double height = 170d;
		Integer age = 25;
		Double bmr = m.countBmr(gender, weight, height, age);
		
		//2.无运动习惯=BMR(基础代谢)*1.2（基本没有运动）一般都是这轻体力的
		//轻度运动=BMR(基础代谢)*1.375（一周1~3次轻微强度的运动）一般都是这轻体力的
		//		中等运动强度=BMR(基础代谢)*1.55（一周3~5次中等强度运动）增肌健身的可能达到中体力
		Double habits = 1.2d;
		Double totalEnergy = m.countTotalEnergy(bmr, habits);
		
		Double minEnergy = totalEnergy-200;
		Double maxEnergy = totalEnergy+200;
		System.out.println(totalEnergy);
		System.out.println(minEnergy);
		System.out.println(maxEnergy);
	}
        
    public Double countBmr(Integer gender, Integer weight, Double height, Integer age) {
    	Double BMR = null;
        if(gender == 1){
            BMR = 66+(13.7*weight)+(5*height)-(6.8*age);
        }else if (gender == 2){
            BMR = 655.1+(9.6*weight)+(1.8*height)-(4.7*age);
        }
        return BMR;
    }
    
    //总所需热量
    //exerHabits无运动习惯1.2   轻度运动1.375   中等运动强度1.55
    public Double countTotalEnergy(Double BMR,Double habits) {
    	return habits*BMR;
    }
}
